#include "clueCardPlayStatusReqMessageHandler.h"
#include "clueCardPlayStatusReqMessage.h"
#include <SDL.h>
#include "constant.h"
#include "messageResInfo.h"

void ClueCardPlayStatusReqMessageHandler::handle(MtpMessage* message, const IPaddress& attachment)
{
    SDL_Event event;
    event.type = FF_CLUE_CARD_PLAY_STATE;
    MtpProtocol* packet = (MtpProtocol*)message->getPacket();
    const ClueCardParam& param = ((ClueCardPlayStatusReqMessage*)message)->getParam();
    event.user.data1 = new MessageResInfo(attachment, packet->getVersion(), packet->getCommandId());
    event.user.data2 = new ClueCardParam(param.getClueCardId(), param.getChannel());
    SDL_PushEvent(&event);
}

MtpMessage* ClueCardPlayStatusReqMessageHandler::decode(MtpProtocol* packet, const IPaddress& attachment)
{
    return new ClueCardPlayStatusReqMessage(packet);
}
